<template>
  <el-dialog
    title="提示"
    :visible.sync="visible"
    :before-close="close"
    width="30%">
    <component :is="curComp" :id="id"></component>
  </el-dialog>
</template>

<script>
  export default {
    components: {
      Test1: () => import('@/views/Test1.vue'),
      Test2: () => import('@/views/Test2.vue')
    },
    props: {
      curComp: {
        type: String,
        default: ''
      },
      id: Number
    },
    data() {
      return {
        visible: true
      }
    },
    methods: {
      close() {
        this.$emit('update:curComp', '')
      }
    },
  }
</script>

<style lang="scss" scoped>

</style>